<template>
	<div class='container'>
		<p>inheritAttrs为true时，根元素上<mark>会</mark>带父组件配置的属性（没在props中的）</p>
	</div>
</template>

<script>
import { defineComponent } from 'vue';
export default defineComponent({
	name: 'MyChild',
	inheritAttrs: true,//用于控制是否启用默认的组件 attribute 透传行为。
	props: {
		title: {
			type: String,
			default: ''
		}
	},
	emits: ['click'],
	setup(props, cxt) {
		const { attrs} = cxt;
		console.log({ attrs });
		return {

		}
	}
})
</script>
<style lang='less' scoped>
.container {}
</style>

